/*
 *  NoteInfo.cpp
 *  SoundController0002
 *
 *  Created by jiro on 10/12/05.
 *  Copyright 2010 jiro music. All rights reserved.
 *
 */

#include "NoteInfo.h"
#include "WellTemperament.h"
#include <sstream>

namespace sc {

	NoteInfo::NoteInfo()
		: frequency( 0.0 ),
		  duration( 0.0 ),
		  dynamics( 0.0 ),
		  phaseShift( 0.0 )
	{}

	NoteInfo::NoteInfo( Note::MidiNumber number, double duration, double dynamisc )
		: frequency( WellTemperament::GetFrequency( number ) ),
		  duration( duration ),
		  dynamics( dynamics ),
		  phaseShift( 0.0 )
	{}

	NoteInfo::NoteInfo( double frequency, double duration, double dynamics )
		: frequency( frequency ),
		  duration( duration ),
		  dynamics( dynamics ),
		  phaseShift( 0.0 )
	{}

	NoteInfo::NoteInfo( Note::MidiNumber number, double duration, double dynamics, double phaseShift )
		: frequency( frequency ),
		  duration( duration ),
		  dynamics( dynamics ),
		  phaseShift( phaseShift )
	{}

	NoteInfo::NoteInfo( double frequency, double duration, double dynamics, double phaseShift )
		: frequency( frequency ),
		  duration( duration ),
		  dynamics( dynamics ),
		  phaseShift( phaseShift )
	{}

	std::string NoteInfo::ToString() const
	{
		std::stringstream ss;
		ss << "frequency: " << frequency << ", duration: " << duration << ", dynamics: " << dynamics << ", phaseShift: " << phaseShift;
		return ss.str();
	}

}
